// TcpServer.cc文件
#include "TcpServer.hpp"
#include <memory>

void Usage(std::string proc)
{
    std::cerr << "Usage: " << proc << " port" << std::endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(ExitCode::USAGE_ERR);
    }
    uint16_t port = std::stoi(argv[1]);
    LogToConsole();
    std::unique_ptr<TcpServer> tcp_server = std::make_unique<TcpServer>(port);
    tcp_server->Init();
    tcp_server->Run();
    return 0;
}
